package com.fs.spring.test.aop.service;

import com.fs.spring.test.aop.monitor.PerformanceMonitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * @author shuai.fang
 * @date：2017-08-10
 * @description：
 */
@Service
public class ForumServiceWithOutProxyImpl implements ForumService {

	private Logger logger = LoggerFactory.getLogger(getClass());

	public void removeTopic() {
		PerformanceMonitor.begin("ForumServiceImpl#removeTopic");
		try {
			TimeUnit.SECONDS.sleep(2);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		logger.info("执行删帖操作....");
		PerformanceMonitor.end();
	}

	public void removeForum() {
		PerformanceMonitor.begin("ForumServiceImpl#removeForum");
		try {
			TimeUnit.SECONDS.sleep(2);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		logger.info("执行删除主题操作...");
		PerformanceMonitor.end();
	}
}
